package com.glsc.ngateway.common.api.flowable.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * @author weizt
 * @date 2022/12/20
 * IT事件统计条件
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@EqualsAndHashCode(callSuper=false)
public class EventStatisticParamDto implements Serializable {

    private static final long serialVersionUID = -881076144610735992L;

    @ApiModelProperty(value = "事件报告起始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate happenBeginDate;

    @ApiModelProperty(value = "事件报告结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate happenEndDate;

    @ApiModelProperty(value = "开始时间yyyy-MM-dd")
    private String startTime;

    @ApiModelProperty(value = "结束时间yyyy-MM-dd")
    private String endTime;

    @ApiModelProperty(value = "事件成因，是否外部0 内部 1外部")
    private List<Integer> eventCause;

    @ApiModelProperty(value = "发起人账号")
    private String flowCreateOperatorAccount;
}
